Skip to content

fix(review): install bubblewrap before the review lanes run Claude Code - #760

Merged
kyle-sexton merged 2 commits into
mainfrom
fix/review-install-bubblewrap
Oct 17, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
fix/review-install-bubblewrap

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: org-wide outage fix; every AI review lane run since about 18:39Z 2026-10-17 fails while installing Claude Code.

Summary

#756 set CLAUDE_CODE_SUBPROCESS_ENV_SCRUB: "1" on both review attempts in pr-review.yml and pr-review-security.yml. Claude Code 2.1.300 (the version claude-code-action v1.0.250 installs) refuses to start on Linux with the scrub on and no bubblewrap:

error: bubblewrap is required for subprocess env scrubbing and isolation. Install with: sudo apt-get install -y bubblewrap, set sandbox.bwrapPath in managed settings, or set CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=0 to disable (loses subprocess isolation).

(claude-code-plugins run 39059470151.) The action's own "Install subprocess isolation dependencies" step runs only when allowed_non_write_users is set, which the review lanes do not set, so nothing installed bwrap. intake-triage.yml sets allowed_non_write_users: "*", so the action installs it there and that lane is unaffected.

Fix

Add an "Install subprocess isolation" step before the first review attempt in both workflows: apt-get install bubblewrap and socat with three retries, lift the Ubuntu 24.04 AppArmor userns restriction, and fail closed when bwrap is missing. This matches the action's step and claude-code-plugins' setup-runner-isolation action. The scrub stays on. The fallback attempt runs in the same job, so one install covers both.

Verification

  • actionlint over both files: no new findings. The $/.github/actions/report-lane-outcome finding was already on main.
  • node --test .github/scripts/*.test.cjs: 420 passed, 0 failed.
  • This PR's own review lanes run the patched copy only after merge; the check that matters is the first caller run after the repin.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01AfcE6qXwStK92XAx21MG43

#756 set CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 on both review attempts.
Claude Code 2.1.300 on Linux refuses to start with the scrub on and no
bubblewrap, and claude-code-action installs bubblewrap only when
allowed_non_write_users is set, so every review lane failed while
installing Claude Code. Install bubblewrap and socat before the first
attempt, with apt retries and the AppArmor userns sysctl, and fail closed
without bwrap. The scrub stays on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AfcE6qXwStK92XAx21MG43
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 17, 2026 18:51
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T18:54:09.665535Z 8674697 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 3m 49s —— View job


Security review

  • Gather context (PR diff, changed workflow files)
  • Review pr-review.yml changes
  • Review pr-review-security.yml changes
  • Check for instruction-surface deletions / guardrail changes (none — diff is purely additive)
  • Post findings

Reviewed only the two changed files (pr-review.yml, pr-review-security.yml), scoped to the new "Install subprocess isolation" step each adds.

IMPORTANT — host-wide kernel-hardening weakening with no reset, on a caller-selectable runner

Both new steps run sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0:

This is the only sysctl call anywhere under .github/, and nothing in either job resets it afterward. The runner input these jobs use is "selected by the caller's governed selector" (not hardcoded to a GitHub-hosted image), and README.md documents that this routing has previously landed callers on a self-hosted image (the 2026-07-18 do-not-merge incident). If that selector resolves to a persistent, reused self-hosted runner rather than an ephemeral GitHub-hosted one, this step silently and durably (until next reboot) disables an AppArmor control that restricts unprivileged user-namespace creation — a mitigation for several namespace-based sandbox-escape/privilege-escalation techniques — for every later job scheduled on that host, not just this PR's review, including unrelated repos and PRs. The step already fails closed when bwrap is missing; it should fail closed (or explicitly scope/restore the sysctl) when the runner can't be confirmed ephemeral, e.g. an always() cleanup step that restores the prior value before the job ends.

This is a real trade-off the bubblewrap requirement forces (matches the upstream claude-code-action and claude-code-plugins isolation steps the PR cites), so the install itself is reasonable — the gap is specifically the missing restore/guard given this repo's runners are not guaranteed ephemeral.

No other security issues found. The apt-get retry loop and bwrap presence check have no injection surface (no untrusted input reaches the run: block), the step is correctly gated behind the same steps.scope.outputs.review != 'false' condition as the review step it precedes, and it runs once per job ahead of both the primary and fallback review attempts, matching the PR's stated intent. No instruction-surface deletions in this diff — it's purely additive.

Actions-hardening concerns (trigger safety, permissions, pinning) are zizmor's lane and out of scope here; this PR's triggers/permissions are unchanged.

@claude

claude Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 4m 40s —— View job


Code review

  • Gather context (PR diff, CLAUDE.md, REVIEW.md, standards)
  • Review changed workflow files for correctness
  • Check paved-path / standards alignment
  • Post findings

Scope: .github/workflows/pr-review.yml and .github/workflows/pr-review-security.yml (identical 24-line "Install subprocess isolation" step added to each, per pr-review.yml#L573-L595 and the matching block in pr-review-security.yml). No security-lane findings reported here, per REVIEW.md scope split (this repo has a dedicated pr-review-security.yml lane).

No blocking or advisory findings. Specifically verified:

  • Root-cause claim checks out: neither pr-review.yml nor pr-review-security.yml sets allowed_non_write_users, while intake-triage.yml does (allowed_non_write_users: "*" at intake-triage.yml#L367), matching the PR's explanation of why that lane alone was unaffected.
  • Step placement is correct: it runs once, after Compose Claude CLI arguments and before the first Claude review step, in the single claude job both review attempts (primary and fallback) share — one install does cover both, as claimed.
  • Gating (if: steps.scope.outputs.review != 'false') matches the existing convention used by the sibling compose-args/full-diff steps in the same job.
  • Fail-closed behavior is intentional and consistent with the job's existing design: this step has no continue-on-error, so an install failure propagates through the existing no-outcome classification path in Report the review status (same place auth/rate-limit/timeout failures already surface) rather than silently passing — it doesn't bypass the "Claude lane checks stay advisory" contract, since that's about branch-protection configuration (ci-status is the only required check), not about whether this job itself can go red.
  • CLAUDE_CODE_SUBPROCESS_ENV_SCRUB: "1" is left in place in both files (scrub stays on), and the fix adds isolation rather than disabling scrubbing.
  • The verbatim duplication of this step across the two sibling workflow files matches the pre-existing, deliberate pattern already used for the rest of each job body (both files' headers describe themselves as siblings kept in sync manually); this repo's standards index has no paved-path row to apply here, and consolidating the two workflows into a shared composite action would be a larger refactor out of scope for this outage hotfix.

Author-claimed, not independently re-run here: actionlint (no new findings) and node --test .github/scripts/*.test.cjs (420 passed) results stated in the PR body.
· branch

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 86746973f7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/pr-review.yml Resolved
Comment thread .github/workflows/pr-review.yml Resolved
Comment thread .github/workflows/pr-review.yml Resolved
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

claude-security-review has reviewed this pull request through bd64d9c; a later push is reviewed from there.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

claude-review has reviewed this pull request through bd64d9c; a later push is reviewed from there.

…time

Run the bubblewrap install only on Linux, skip apt-get where it is absent
(bwrap must then be present), lift the AppArmor userns sysctl only on
GitHub-hosted runners, and bound the step at one minute. The code lane's
job timeout rises from 13 to 16 minutes; the security lane is already at
the 16-minute ceiling, so its review step budget drops from 14 to 13
minutes to keep the measured 38 s of slack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AfcE6qXwStK92XAx21MG43
@claude

claude Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 1m 36s —— View job


Security review (incremental)

  • Gather context (incremental diff, changed files)
  • Review .github/scripts/claude-lane-scope.test.cjs changes
  • Review .github/workflows/pr-review-security.yml changes
  • Review .github/workflows/pr-review.yml changes
  • Check instruction-surface deletions lens
  • Post findings

Scope: incremental diff only, since this lane's last review at 8674697 — budget renumbering (11/13/16-minute values) and the "Install subprocess isolation" step's logic in both workflow files, plus the matching test expectations in claude-lane-scope.test.cjs.

No security issues found.

This diff resolves the IMPORTANT finding from the prior round (host-wide, unreset AppArmor weakening on a potentially non-ephemeral runner, raised against pr-review.yml#L590 at 8674697):

  • The sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 mutation is now gated on [ "$RUNNER_HOSTING" = github-hosted ], where RUNNER_HOSTING is set from the runner.environment Actions context — pr-review.yml#L598-L601, and identically in pr-review-security.yml#L555-L558.
  • runner.environment is a built-in Actions context populated by the runtime from the actual runner type, not from PR input or the caller's governed runner selector — a workflow run cannot spoof it to github-hosted to force the sysctl path onto a self-hosted/shared host. GitHub-hosted runners are single-use VMs torn down at job end, so the weakening no longer outlives this job on a reused host; self-hosted runners now skip the sysctl change entirely (and fail closed later if that means bwrap doesn't start).
  • The new runner.os == 'Linux' gate and the command -v apt-get guard only change which runners run the Debian-specific install path; they don't widen any trust boundary or add an injection surface (both are static/context-derived checks, no untrusted input reaches the run: block).
  • timeout-minutes: 1 on the new step and the renumbered job/step timeouts in both workflows and the test file are budget bookkeeping, not security-relevant.
  • No instruction-surface deletions in this diff (no CLAUDE.md/AGENTS.md/rules/skill changes) — purely workflow YAML and a test file.
  • CLAUDE_CODE_SUBPROCESS_ENV_SCRUB scrub remains on in both files; this diff only refines when/how the isolation prerequisite is installed.

Actions-hardening concerns (trigger safety, permissions, pin changes) are zizmor's lane and out of scope here; nothing in this incremental diff touches triggers, permissions, or action pins.
· branch

@claude

claude Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 7m 53s —— View job


Code review

  • Read the incremental diff (8674697→bd64d9c) and resolve the standards index (no paved-path row; nothing to apply there)
  • Review claude-lane-scope.test.cjs timeout-assertion changes against the actual YAML
  • Review the runner.os == 'Linux' / apt-get presence gating in both workflows
  • Review the RUNNER_HOSTING / AppArmor-sysctl scoping fix in both workflows
  • Adversarially verify candidate findings (review:lane-verifier, independent agent)
  • Post inline comments

Scope: this commit only (8674697→bd64d9c), across the 3 changed files. It directly answers the two Codex P2 findings from the prior round (Linux-only gating + a reused apt-get-less path, and reserving job/step time for the new install) and narrows the security finding (AppArmor sysctl lift now scoped to runner.environment == 'github-hosted' instead of unconditional) — all three verified against the actual line numbers, not just the PR description.

Verified correct:

  • claude-lane-scope.test.cjs's two updated tuples ([codeLane, 11, 16], [securityLane, 13, 16]) match the files' actual timeout-minutes values I read directly: pr-review.yml job 16 min / step 11 min (unchanged), pr-review-security.yml job 16 min (unchanged) / step 13 min (down from 14).
  • Both workflows' updated job-timeout comments do the arithmetic correctly: pr-review.yml's 960 − 660(step) − 60(install) − 82(max overhead) = 158s margin; pr-review-security.yml's 960 − 780(step) − 60(install) − 82(max overhead) = 38s margin.
  • The runner.os == 'Linux' gate and the command -v apt-get fallback correctly address both halves of Codex's first finding (non-Linux runners skip the step entirely; a Linux runner without apt-get is required to already have bwrap).
  • timeout-minutes: 1 on the install step, paired with the job/step timeout changes above, addresses Codex's second finding (reserving time for the new install so the always-run status step stays reachable).

Findings posted inline (both independently verified by a separate review:lane-verifier pass before posting):

  1. claude-lane-scope.test.cjs — no test guards the two Install subprocess isolation steps against drifting apart, unlike the existing equality test for their sibling scope/record scripts, even though this commit made the step meaningfully denser.
  2. pr-review.yml#L598-L605 / pr-review-security.yml#L555-L562 — advisory, lower confidence: the fail-closed check only verifies the bwrap binary is present, not that it can actually create an unprivileged user namespace, so a self-hosted Linux runner with a still-restrictive AppArmor default (sysctl lift is now skipped there on purpose) could pass this step yet still hit a sandbox failure later. A reasonable trade-off for the prior review's security ask, just currently undocumented.

Not independently run (sandboxed to read-only git/grep/find in this environment; node --test and node -e required approval that wasn't available): the PR's claimed actionlint and node --test .github/scripts/*.test.cjs (420 passed) results are author-claimed, not verified by me. I did independently verify the test file's updated numeric assertions by reading the actual workflow YAML and checking the arithmetic by hand (above), which doesn't require running the suite.
· branch

Comment thread .github/workflows/pr-review.yml Resolved
@kyle-sexton
kyle-sexton merged commit bc02e05 into main Oct 17, 2026
29 checks passed
@kyle-sexton
kyle-sexton deleted the fix/review-install-bubblewrap branch October 17, 2026 19:22
kyle-sexton added a commit that referenced this pull request Oct 20, 2026
…ed in status (#813)

Closes #657

## Summary

When a review step fails without leaving an execution file, and it
neither timed out nor failed its Bun install, the lane reported `other`,
and the status step printed "an unclassified failure". That case now
gets its own class, `no-execution`. Both lanes' status steps also gain
an arm for `install-failed`, which the classifier could already return
but the status steps did not handle by name.

## Fix

- `.github/actions/report-lane-outcome/classify.cjs`: with no execution
file, the class is `timeout`, then `install-failed`, otherwise
`no-execution`. An execution file that exists but cannot be parsed still
classifies as `other`, which is outside this issue's scope. The class
list in the header comment now includes `no-execution`.
- `.github/actions/report-lane-outcome/action.yml`: the `execution-file`
input description and the `failure-class` output description now name
`no-execution`.
- `pr-review.yml` and `pr-review-security.yml`:
- the status steps get `install-failed)` and `no-execution)` case arms,
placed before `*)`. Both fall through to the existing `exit 1`.
- the `failure-class` output descriptions now list `install-failed` and
`no-execution`.
- `README.md`: the red-status list names `install-failed` and
`no-execution`. Only line 1125 changed (one line inserted).
- Tests:
- `classify.test.cjs`: the existing no-execution-file test now asserts
`no-execution`, including with explicit `timedOut: false, installFailed:
false`.
- `outcome-step.test.cjs`: two assertions that expected `other` for the
no-file path now expect `no-execution`.
- The existing `timeout` and `install-failed` tests are unchanged and
pass.
- Effect on other callers:
- `run-claude-cli/lane.cjs` also calls `classifyExecutionFile`. A CLI
leg that leaves no file and did not time out now reports `no-execution`.
Its summary note falls back to the `other` note.
- `intake-triage.yml`'s status allowlist maps any unknown class to
`other`, so intake output does not change.
- No step timeout was changed: `pr-review-security.yml:613` is still
`timeout-minutes: 13`.

## Verification

- `node --test .github/scripts/*.test.cjs`: 471 tests, 471 pass, 0 fail.
- `node --test .github/scripts/*.test.cjs .github/actions/*/*.test.cjs`:
559 tests, 559 pass, 0 fail. Before the edit, the same command gave
559/559. After the classifier change, 2 `outcome-step` tests failed
because they still asserted `other`; they were updated as described
above.
- `node --test .github/actions/*/*.test.cjs`: 88 tests, 88 pass, 0 fail.
- `actionlint .github/workflows/pr-review.yml
.github/workflows/pr-review-security.yml`: clean.
- `grep -n "timeout-minutes: 13"
.github/workflows/pr-review-security.yml`: line 613.

## Related

- #811 (issue #761) adds `sandbox-unavailable` to the same README
red-status paragraph, on lines 1127-1128. This PR changes only line 1125
and leaves line 1126 untouched, so the two hunks should not overlap.
Whichever PR merges second must keep both sets of rows.
- #691 added the `install-failed` class. #760 set the security step
timeout to 13 minutes. Also related: #795.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant